package com.mc.lp.database.entity.type;

public enum ContactType {
	PRIMARY(0), HOME(1), BUSINESS(2), MOBILE(3), OTHER(4);
	
	private ContactType(int id) {
		this.id = id;
	}

	int id;

	public static ContactType getType(Integer id) {

		if (id == null) {
			return null;
		}

		for (ContactType contactType : ContactType.values()) {
			if (id.equals(contactType.getId())) {
				return contactType;
			}
		}
		throw new IllegalArgumentException("No matching type for id " + id);
	}

	public int getId() {
		return id;
	}
}
